package com.itita.ww2.web.gm;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.itita.ww2.common.WebProxy;
import com.itita.ww2.common.WebResponse;
import com.itita.ww2.web.core.AbstractHttpServlet;

/**
 * 用户信息获取
 * @author NorthLan
 *
 */
public class GetUserInfo extends AbstractHttpServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected String handleRequest(WebProxy webProxy, HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		final Map<String, String[]> params = req.getParameterMap();
		WebResponse ret = null;
		if (params.containsKey("nickname")) {
			ret = webProxy.getUserInfoByNickName(req.getParameter("nickname"));
		} else if (params.containsKey("uid")) {
			ret = webProxy.getUserInfoByUid(Integer.valueOf(req.getParameter("uid")));
		} else if (params.containsKey("email")) {
		}
		return ret.toJson();
	}

}
